package cn.sunzq.springdata.elasticsearch.demo.document;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @创建人 孙中泉
 * @创建时间 2021/7/20
 * @描述
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Document(indexName = "temp_lincolnshire")
public class TempLincolnshireDocument implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Field(type = FieldType.Integer)
    private Integer id;

    @Field(type = FieldType.Keyword)
    private String name;

    @Field(type = FieldType.Keyword)
    private String year;

    @Field(type = FieldType.Keyword)
    private String month;

    @Field(type = FieldType.Keyword)
    private String day;

    @Field(type = FieldType.Keyword)
    private String hours;

    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second_fraction , pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
    private Date time;

    @Field(type = FieldType.Double)
    private BigDecimal value;

}
